import request from '@/utils/request'

export default {

  // 分页查询
  findPage: params => request('/api/ucenter/role/page', {
    method: 'get',
    params,
  }),

  // 查询列表
  findList: params => request('/api/ucenter/role/list', {
    method: 'get',
    params,
  }),

  // 添加
  add: data => request('/api/ucenter/role', {
    method: 'post',
    data,
  }),

  // 添加
  edit: (id, data) => request(`/api/ucenter/role/${id}`, {
    method: 'put',
    data,
  }),

  // 删除
  remove: id => request(`/api/ucenter/role/${id}`, {
    method: 'delete',
  }),

  // 设置菜单
  setMenuIds: (id, data) => request(`/api/ucenter/role/${id}/menu`, {
    method: 'POST',
    data,
  }),
}
